# Contributor: August Klein <amatcoder@gmail.com>
# Maintainer: August Klein <amatcoder@gmail.com>
pkgname=nzbget
pkgver=21.1
pkgrel=2
pkgdesc="Usenet downloader"
url="https://nzbget.net"
arch="all"
license="GPL-2.0-or-later"
makedepends="libxml2-dev ncurses-dev openssl-dev"
subpackages="$pkgname-doc"
source="https://github.com/nzbget/nzbget/releases/download/v$pkgver/nzbget-$pkgver-src.tar.gz
	openssl3.patch
	"

prepare() {
	default_prepare

	update_config_sub
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--enable-parcheck \
		--with-tlslib=OpenSSL
	make
}

check() {
	make check
}

package() {
	make -j1 DESTDIR="$pkgdir" install
}

sha512sums="
d8dc1ad324f675c5505e623049a14c022475267aa03dcd5d8fd6cf9ed3b776cc2776077b61d035e252937ea4b6bf8f90bd33e715cfd842d2e012615df3ffeafb  nzbget-21.1-src.tar.gz
d080db57ee71ca04466b649cce7ca6a32d9fbecee0feae7b5c07482e7590202235e0b8d61dc8b60b4acf3c5bdd6c063042a212951b2d51a13ffe6c547a9ecc2e  openssl3.patch
"
